package com.qeegoo.b2bautozityp.injector.module;

import com.qeegoo.b2bautozityp.R;
import com.qeegoo.b2bautozityp.api.RequestApi;
import com.qeegoo.b2bautozityp.injector.PerActivity;
import com.qeegoo.b2bautozityp.moudle.base.AppBar;
import com.qeegoo.b2bautozityp.moudle.home.viewmodel.MainViewModel;

import dagger.Module;
import dagger.Provides;

/**
 * 王少岩 在 2017/9/13 创建了它
 */

@Module
public class MainModule {

    @Provides
    @PerActivity
    public AppBar provideAppBar() {
        AppBar appBar = new AppBar("中驰淘优配", R.mipmap.ic_user);
        appBar.setBgColor(R.color.blue);
        appBar.setTitleColor(R.color.white);
        return appBar;
    }

    @Provides
    @PerActivity
    public MainViewModel provideViewModel(RequestApi api){
        return new MainViewModel(api);
    }
}
